﻿namespace HuaWei.CBR.QTJL
{
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using HuaWei.CommClass;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Windows.Forms;

    public class FrmSPYJ : Form
    {
        private BindingSource bindingSource;
        private BindingSource bindingSource1;
        private SimpleButton btnCancel;
        private SimpleButton btnOK;
        private DateEdit detSPRQ;
        private TextEdit edtSPR;
        private MemoEdit edtSPYJ;
        private IContainer icontainer = null;
        private LabelControl labelControl1;
        private LabelControl labelControl3;
        private LabelControl LfoCoObmo;

        public FrmSPYJ()
        {
            this.InitializeComponent();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            base.DialogResult = System.Windows.Forms.DialogResult.Cancel;
        }

        private void btnOK_Click(object sender, EventArgs e)
        {
            DataView list = this.bindingSource.List as DataView;
            foreach (DataRowView view2 in list)
            {
                DataRow row = view2.Row;
                row["SHRQ"] = this.detSPRQ.Text;
                row["SHR"] = this.edtSPR.Text;
                row["SHYJ"] = this.edtSPYJ.Text;
                row.EndEdit();
            }
            base.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer != null))
            {
                this.icontainer.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.icontainer = new Container();
            this.labelControl1 = new LabelControl();
            this.detSPRQ = new DateEdit();
            this.LfoCoObmo = new LabelControl();
            this.edtSPR = new TextEdit();
            this.edtSPYJ = new MemoEdit();
            this.labelControl3 = new LabelControl();
            this.btnOK = new SimpleButton();
            this.btnCancel = new SimpleButton();
            this.bindingSource1 = new BindingSource(this.icontainer);
            this.detSPRQ.Properties.VistaTimeProperties.BeginInit();
            this.detSPRQ.Properties.BeginInit();
            this.edtSPR.Properties.BeginInit();
            this.edtSPYJ.Properties.BeginInit();
            ((ISupportInitialize) this.bindingSource1).BeginInit();
            base.SuspendLayout();
            this.labelControl1.Location = new Point(0x13, 0x1c);
            this.labelControl1.Name = "labelControl1";
            this.labelControl1.Size = new Size(0x30, 14);
            this.labelControl1.TabIndex = 0;
            this.labelControl1.Text = "审批日期";
            this.detSPRQ.EditValue = null;
            this.detSPRQ.Location = new Point(0x4c, 0x19);
            this.detSPRQ.Name = "detSPRQ";
            this.detSPRQ.Properties.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.detSPRQ.Properties.VistaTimeProperties.Buttons.AddRange(new EditorButton[] { new EditorButton() });
            this.detSPRQ.Size = new Size(100, 0x15);
            this.detSPRQ.TabIndex = 1;
            this.LfoCoObmo.Location = new Point(0xb9, 0x1c);
            this.LfoCoObmo.Name = "labelControl2";
            this.LfoCoObmo.Size = new Size(0x24, 14);
            this.LfoCoObmo.TabIndex = 2;
            this.LfoCoObmo.Text = "审批人";
            this.edtSPR.Location = new Point(230, 0x19);
            this.edtSPR.Name = "edtSPR";
            this.edtSPR.Properties.ReadOnly = true;
            this.edtSPR.Size = new Size(100, 0x15);
            this.edtSPR.TabIndex = 3;
            this.edtSPYJ.Location = new Point(0x13, 0x5b);
            this.edtSPYJ.Name = "edtSPYJ";
            this.edtSPYJ.Size = new Size(0x18d, 0x60);
            this.edtSPYJ.TabIndex = 4;
            this.labelControl3.Location = new Point(0x13, 0x47);
            this.labelControl3.Name = "labelControl3";
            this.labelControl3.Size = new Size(0x30, 14);
            this.labelControl3.TabIndex = 5;
            this.labelControl3.Text = "审批意见";
            this.btnOK.Location = new Point(0x7e, 0xc3);
            this.btnOK.Name = "btnOK";
            this.btnOK.Size = new Size(0x4b, 0x17);
            this.btnOK.TabIndex = 6;
            this.btnOK.Text = "确定";
            this.btnOK.Click += new EventHandler(this.btnOK_Click);
            this.btnCancel.Location = new Point(0xea, 0xc4);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new Size(0x4b, 0x17);
            this.btnCancel.TabIndex = 7;
            this.btnCancel.Text = "取消";
            this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
            this.bindingSource1.DataMember = "SPYJ";
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x1b3, 0xef);
            base.Controls.Add(this.btnCancel);
            base.Controls.Add(this.btnOK);
            base.Controls.Add(this.labelControl3);
            base.Controls.Add(this.edtSPYJ);
            base.Controls.Add(this.edtSPR);
            base.Controls.Add(this.LfoCoObmo);
            base.Controls.Add(this.detSPRQ);
            base.Controls.Add(this.labelControl1);
            base.Name = "FrmSPYJ";
            base.StartPosition = FormStartPosition.CenterParent;
            this.Text = "审批意见";
            this.detSPRQ.Properties.VistaTimeProperties.EndInit();
            this.detSPRQ.Properties.EndInit();
            this.edtSPR.Properties.EndInit();
            this.edtSPYJ.Properties.EndInit();
            ((ISupportInitialize) this.bindingSource1).EndInit();
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        public void SetFrmParam(BindingSource bs)
        {
            this.bindingSource = bs;
            DataRow dataRow = DHelp.GetDataRow(this.bindingSource);
            if (dataRow != null)
            {
                this.detSPRQ.Text = dataRow["SHRQ"].ToString();
                this.edtSPR.Text = dataRow["SHR"].ToString();
                this.edtSPYJ.Text = dataRow["SHYJ"].ToString();
            }
        }
    }
}

